﻿using System.Diagnostics;

namespace HaoCoding.DCdb.General.Extensions
{
    public static class StopwatchExtensions
    {
        /// <summary>
        /// 获取执行的速度
        /// </summary>
        /// <param name="sw">计时器</param>
        /// <param name="count">执行次数</param>
        /// <returns>每秒执行多少次</returns>
        public static double GetSpeed (this Stopwatch sw, long count)
        {
            return count / (sw.ElapsedMilliseconds / 1000.0);
        }

    }
}
